package tree.nodeType.Boolean;

import java.util.ArrayList;

import pools.PoolsManager;
import tree.Node;
import tree.TreeNodesManager;
import tree.nodeType.BooleanFunction;

public abstract class BooleanBooleanSonsFunction extends BooleanFunction{
	public BooleanBooleanSonsFunction(int sonsNeeded, Node parent,TreeNodesManager treeNodesManager
									  ,int depth) {
		super(sonsNeeded, parent,depth);
		
		if (treeNodesManager!=null){
			treeNodesManager.addBooleanNode(this);
		}
	}
	
	@Override
	protected ArrayList<Node> getProperNodesManagerList(
			TreeNodesManager treeNodeManager) {	
		return treeNodeManager.getAllBooleansFunctionInTree();
	}
	public BooleanBooleanSonsFunction() {}
	
//	@Override
//	public Node getRandNodeWithTheSameReturnType(int maxDepth,TreeNodesManager tnm){
//		return PoolsManager.get().getRandomBooleanNode(getDepth(),maxDepth, getParent(),tnm);		
//	}
	@Override
	public Node getRandNode(int maxDepth,TreeNodesManager tnm){
		return PoolsManager.get().getRandomBooleanWithBooleanSonsNode(getDepth(),maxDepth, getParent(),tnm);
	}
}
